﻿using UnityEngine;
using Newtonsoft.Json;

public class SwitchConfigInfo
{
	public bool isEnableHotFix = false;
	public bool isEnableGuiLog = true;
	public string decompressLocalBundleMode;
}

public static class SwitchConfig
{
	private static SwitchConfigInfo _info;

	static void init()
	{
		if(_info == null)
		{
            TextAsset versionAsset = Resources.Load<TextAsset>("switch_config");
            if (versionAsset != null)
            {
                string str = versionAsset.text;
                _info = JsonConvert.DeserializeObject<SwitchConfigInfo>(str);
            }
			else
			{
				_info = new SwitchConfigInfo();
			}
		}
	}
	
	
	public static bool isEnableHotFix
	{
		get
		{
			init();
			return _info.isEnableHotFix;
		}
	}
	
	
	public static bool isEnableGuiLog
	{
		get
		{
			init();
			return _info.isEnableGuiLog;
		}
		set
		{
			init();
			_info.isEnableGuiLog = value;
		}
	}

	public static string decompressLocalBundleMode
	{
		get
		{
			init();
			return _info.decompressLocalBundleMode;
		}
		set
		{
			init();
			_info.decompressLocalBundleMode = value;
		}
	}
}
